home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Computers
/
Creative Computers CD-ROM, Volume 1 (Legendary Design Technologies, Inc.)(1994).iso
/
shareware
/
games
/
uchess
/
src
/
movemem.asm
< prev
next >
Wrap
Assembly Source File
|
1994-11-17
|
2KB
|
147 lines
CSECT text
; XDEF @MoveMem
XDEF @MoveMem128
XDEF @ClearMem
; D0 has # bytes to move
; A0 has source addre
; a1 has dest addr
@MoveMem128 equ *
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
rts
IFD REGMOVE
@MoveMem equ *
move.l D0,D1
andi.l #$1,D1
beq.s OKTOGO
move.b (a0)+,(a1)+
OKTOGO: andi.l #2,d1
beq.s OKTOG2
move.w (a0)+,(a1)+
OKTOG2: lsr.l #2,D0 ; now d0 has # of longwords to move
move.l d0,d1
beq.s retn2
and #1,d1
beq.s nor6
move.l (a0)+,(a1)+
nor6:
move.l D0,d1
and #2,d1
beq.s nor7
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
nor7:
lsr.l #2,d0
beq.s retn2
subq.l #1,d0
m69:
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
dbra d0,m69
retn2: rts
ENDC
@ClearMem equ * ; a0 has address start d0 has the len in bytes
move.l d2,-(sp)
clr.l d2
move.l a0,d1
bne.s proceed33
retno3: move.l (sp)+,d2
rts
proceed33:
move.l D0,D1
andi.l #$1,D1
beq.s OKTOGO3
clr.b (a0)+
OKTOGO3: andi.l #2,d1
beq.s OKTOG23
clr.w (a0)+
OKTOG23: lsr.l #2,D0 ; now d0 has # of longwords to move
beq.s retno3
move.l a0,d1
andi.l #$1,d1
beq.s fineaddr1
clr.b (a0)+
moveq.l #3,d2
fineaddr1:
move.l a0,d1
andi.l #2,d1
beq.s fineaddr2
clr.w (a0)+
tst.l d2
beq.s mov2
moveq.l #1,d2
bra.s fineaddr2
mov2:
moveq.l #2,d2
fineaddr2:
tst.l d2
beq.s one1
subq.l #1,d0 ; one less lw to move
one1:
move.l d0,d1
beq.s xty
and.l #1,d1
beq.s nor63
clr.l (a0)+
nor63:
move.l D0,d1
and.l #2,d1
beq.s nor73
clr.l (a0)+
clr.l (a0)+
nor73:
lsr.l #2,d0
beq.s xty
; subq.l #1,d0
m693:
clr.l (a0)+
clr.l (a0)+
clr.l (a0)+
clr.l (a0)+
subq.l #1,d0
bne.s m693
; dbra d0,m693
xty: tst.l d2
beq.s retokj
subq.l #1,d2
xtx:
clr.b (a0)+
dbra d2,xtx
retokj:
move.l (sp)+,d2
rts
end